<literal><tagLib name="html"/></literal>
<link href="__BOOTSTRAP_CSS__/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<link href="/Public/js/Select2/select2-master/dist/css/select2.css" rel="stylesheet" />
<script src="/Public/js/Select2/select2-master/dist/js/select2.js"></script>
<script type="text/javascript" src="__PUBLIC__/Ueditor/ueditor.config.js?v={:C('UEDITOR_CONFIG_VERSION')}" charset="utf-8"></script>
<script type="text/javascript" src="__PUBLIC__/Ueditor/ueditor.all.min.js" charset="utf-8"></script>
<script type="text/javascript">
var updAd_edit;
$(function() {
    //重新实例化一个编辑器，防止在上面的editor编辑器中显示上传的图片或者文件
    updAd_edit = UE.getEditor('upload_ue');
    updAd_edit.ready(function () {
        //隐藏编辑器，因为不会用到这个编辑器实例，所以要隐藏
        updAd_edit.hide();
        //侦听图片上传
        updAd_edit.addListener('beforeInsertImage', function (t, arg) {
            var updImgMark = $('#updImg').val();
            if(updImgMark == 100) {
                var html = '';
                $.each(arg, function(index, obj){
                    html = '<div class="input-group margin">'+
                        '<input type="hidden" name="adimg[]" value="'+obj.src+'">'+
                        '<img src="'+obj.src+'" width="80">'+
                        '<a class="btn btn-danger gameAdDelete" role="button" style="margin-left: 15px;">删除</a>'+
                    '</div>';
                    if($("#gameAdImg").children().length >= 5) {
                        $("#gameAdImg").children().eq(0).remove();
                    }
                    $("#gameAdImg").append(html);
                })
            } else {
                $("#upload"+updImgMark).attr("value", arg[0].src);
	            //图片预览
	            $("#preview"+updImgMark).attr("src", arg[0].src).show();                
            }
        });
    });
});

//弹出图片上传的对话框
function upImage(mark) {
    $('#updImg').val(mark);
    var myImage = updAd_edit.getDialog("insertimage");
    myImage.open();
}
</script>
<script type="text/javascript" id="upload_ue"></script>

<literal>
    <php>
        $breadcrumbs = array(
            U("all") => "</literal><if condition="$pageBreadCrumbs neq ''">{$pageBreadCrumbs}<else/>{$tableName}</if><literal>",
            '' =>'添加',            
        );
    </php>
</literal>
<literal><</literal>include file="Public:breadcrumb"<literal>/></literal>

<!-- Main content  -->
<section class="content">
    <div class="row">
        <div class="col-xs-12">      	
        	{$content}
        </div>
    </div>
</section>
<input type="hidden" name="updImg" id="updImg" value=""/>  
<script type="text/javascript" src="__JS__/adddate.js" charset="utf-8"></script>
